package com.punai.config.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.punai.config.domain.ConfigMaterialCategory;
import com.punai.config.domain.vo.ConfigMaterialCategoryVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ConfigMaterialCategoryMapper extends BaseMapper<ConfigMaterialCategory> {

    /**
     * 根据 父级项查询最大排序
     * @param pid
     * @return
     */
    Integer selectMaxOrderNum(@Param("pid")String pid);

    /**
     * 根据类型 查询所有地区
     * @param type
     * @return
     */
    List<ConfigMaterialCategoryVo> selectAllAddress(@Param("type")String type);

    /**
     * 根据类型 父级项与类型查询子分类
     * @param type
     * @param pid
     * @return
     */
    List<ConfigMaterialCategoryVo> selectAllByTypeAndPid(@Param("type")String type, @Param("pid") String pid);


}
